@echo off
rem UTF-8 encoding
chcp 65001 >nul
echo Uninstalling Device Mode Monitor Service...

rem Check for administrator privileges
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo Error: Please run this script as administrator!
    pause
    exit /b 1
)

rem Stop the service
echo Stopping service...
sc stop DeviceModeMonitor
timeout /t 2 >nul

rem Delete the service
echo Deleting service...
sc delete DeviceModeMonitor

if %errorLevel% neq 0 (
    echo Service uninstallation failed!
) else (
    echo Service uninstalled successfully!
)

pause
